﻿using CommunityToolkit.Mvvm.Messaging;
using Company.Core.Logger;
using Company.Shell.DependencyInjection;
using Company.Shell.Models;
using Company.Shell.Views;
using Microsoft.Extensions.DependencyInjection;
using System.Configuration;
using System.Data;
using System.IO;
using System.Windows;

namespace Company.Shell
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public new static App Current => (App)Application.Current;
        public IServiceProvider Services { get; private set; } = ServiceManager.Load();
        protected override void OnStartup(StartupEventArgs e)
        {
            Logs.Info("进入系统");
            Services.GetService<ShellView>()?.Show();
        }

        protected override void OnExit(ExitEventArgs e)
        {
            WeakReferenceMessenger.Default.Send(new OnExitMessage("善后工作"));
        }
    }

}
